package br.com.bestOffer.ejb.pciExpress.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import br.com.bestOffer.ejb.placaMae.entity.PlacaMae;
@Entity
@Table(name="TB07_PCI_EXPRESS")
@NamedQueries({
	@NamedQuery(name="PciExpress.buscarSlotPorIdPlaca", query="SELECT p FROM PciExpress p WHERE p.placaMae.id = :idProduto"),
})
public class PciExpress implements Serializable{

	
    /**
	 * 
	 */
	private static final long serialVersionUID = -7554951623660522108L;

	@Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    
    @Column(name="id_pciExpress",nullable=false)
	private Long id;
    
    @Column(name="versao",nullable=false)
	private String version;
    
    @Column(name="barramento",nullable=false)
	private String barramento;
	
	@ManyToOne(targetEntity = PlacaMae.class,cascade = CascadeType.ALL)
	@JoinColumn(name = "fk_id_placaMae",nullable=false, referencedColumnName="Id_produto")
	private PlacaMae placaMae;
	
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getBarramento() {
		return barramento;
	}
	public void setBarramento(String barramento) {
		this.barramento = barramento;
	}
	public PlacaMae getPlacaMae() {
		return placaMae;
	}
	public void setPlacaMae(PlacaMae placaMae) {
		this.placaMae = placaMae;
	}
	
	
}
